/**
 * 
 */
package com.piz.model.common;

/**
 * @author prameetk.sharma
 *
 */
public enum PaymentTypeEnum {

	CREDITCARD(1l, "Credit Card"), DEBITCARD(2l, "DebitCard"), INTERNETBANKING(3l, "Internet Banking");
	
	private Long id; 

	private String status;
	
	/**
	 * @param id
	 * @param status
	 */
	private PaymentTypeEnum(Long id, String status) {
		this.id = id;
		this.status = status;
	}

	// the valueOfMethod
	  public static PaymentTypeEnum valueOf(Long value) throws Exception
	  {
	    switch (value.intValue())
	    {
	      case 1 :
	        return CREDITCARD;
	      case 2 :
	        return DEBITCARD;
	      case 3 :
	        return INTERNETBANKING;
	    }
	    throw new Exception("Could not find payment type for Id:" + value);
	  }

	  // the valueOfMethod
	  public static PaymentTypeEnum valueOfString(String name) throws Exception
	  {
		  PaymentTypeEnum[] values = PaymentTypeEnum.values();
	    for (PaymentTypeEnum paymenttype : values)
	    {
	      if (name.equals(paymenttype.name()))
	      {
	        return paymenttype;
	      }
	    }
	    throw new Exception("Could not find payment Type for name:" + name);
	  }

	/**
	 * @return the Long id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id Long the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the String status
	 */
	public String getStatus() {
		return status;
	}

	/**
	 * @param status String the status to set
	 */
	public void setStatus(String status) {
		this.status = status;
	}
	  
	  
}
